
/*
 * Copyright 2002-2023 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2023原作者。
 *
 *根据Apache许可证2.0版许可（“许可证”）；
 *除非符合许可证的规定，否则您不得使用此文件。
 *您可以在以下网址获取许可证副本：
 *
 *https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证进行的分发是在“按原样”的基础上进行的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限的特定语言，请参阅许可证和
 *许可证下的限制。
 */

package org.springframework.scheduling;

import org.springframework.core.task.AsyncTaskExecutor;

/**
 * A {@link org.springframework.core.task.TaskExecutor} extension exposing
 * scheduling characteristics that are relevant to potential task submitters.
 *
 * <p>Scheduling clients are encouraged to submit
 * {@link Runnable Runnables} that match the exposed preferences
 * of the {@code TaskExecutor} implementation in use.
 *
 * @author Juergen Hoeller
 * @since 2.0
 * @see SchedulingAwareRunnable
 * @see org.springframework.core.task.TaskExecutor
 */
/**
 *｛@link org.springframework.core.task.Executor｝扩展暴露
 *与潜在任务提交者相关的调度特性。
 *
 *<p>鼓励安排客户提交
 *｛@link Runnable Runnables｝与公开的首选项匹配
 *正在使用的｛@code TaskExecutor｝实现的。
 *
 *@作者于尔根·霍勒
 *@自2.0起
 *@见日程安排AwareRunnable
 *@参见org.springframework.core.task.TaskExecutitor
 */
public interface SchedulingTaskExecutor extends AsyncTaskExecutor {

	/**
	 * Does this {@code TaskExecutor} prefer short-lived tasks over long-lived tasks?
	 * <p>A {@code SchedulingTaskExecutor} implementation can indicate whether it
	 * prefers submitted tasks to perform as little work as it can within a single
	 * task execution. For example, submitted tasks might break a repeated loop into
	 * individual subtasks which submit a follow-up task afterwards (if feasible).
	 * <p>This should be considered a hint. Of course {@code TaskExecutor} clients
	 * are free to ignore this flag and hence the {@code SchedulingTaskExecutor}
	 * interface overall. However, thread pools will usually indicate a preference
	 * for short-lived tasks, allowing for more fine-grained scheduling.
	 * @return {@code true} if this executor prefers short-lived tasks (the default),
	 * {@code false} otherwise (for treatment like a regular {@code TaskExecutor})
	 */
	/**
	 *这个{@code TaskExecution}是否更喜欢短期任务而不是长期任务？
	 *<p>｛@code-SchedulingTaskExecutor｝实现可以指示
	 *更喜欢提交的任务在单个任务中尽可能少地执行工作
	 *任务执行。例如，提交的任务可能会将重复循环分解为
	 *之后提交后续任务的个别子任务（如果可行）。
	 *<p>这应该被视为一个提示。当然｛@code TaskExecutor｝客户端
	 *可以自由忽略此标志，因此可以忽略｛@code-SchedulingTaskExecutor｝
	 *界面整体。但是，线程池通常会指示一个首选项
	 *对于短期任务，允许更细粒度的调度。
	 *@return｛@code true｝如果这个执行器更喜欢短命任务（默认），
	 *｛@code false｝否则（用于像常规的｛@code-TaskExecutor｝一样处理）
	 */
	default boolean prefersShortLivedTasks() {
		return true;
	}

}
